package com.woniuxy.yoga.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.woniuxy.yoga.pojo.Friends;
import com.woniuxy.yoga.service.FriendsService;
import com.woniuxy.yoga.utils.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author axq
 * @since 2020-10-23
 */
@RestController
@RequestMapping("/yoga/friends")
public class FriendsController {

    @Autowired
    private FriendsService friendsService;

    @ApiOperation("我的好友列表")
    @GetMapping("/myfriends/{accountid}")
    public R myFriendsLIst(@PathVariable Integer accountid){
        QueryWrapper queryWrapper  = new QueryWrapper();
        queryWrapper.eq("accountid",accountid);
        List friends = friendsService.list(queryWrapper);

        return R.ok().data("friends",friends);
    }



}

